package com.liukai.java_jxgl.controller;

import com.liukai.java_jxgl.common.Result;
import com.liukai.java_jxgl.model.Dept;
import com.liukai.java_jxgl.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private IDeptService iDeptService;

    @GetMapping("/queryAllDept")
    public Result queryAllDept(){
        List<Dept> deptList = iDeptService.getAllDeptAndClass();
        Result result = Result.succ(deptList);
        return result;
    }

}
